package com.wanxi.step07test.model;

import org.springframework.security.core.GrantedAuthority;

import java.util.Date;

public class Permission implements GrantedAuthority {
    private Integer id;
    private Integer pid;
    private String name;
    private String value;
    private String icon;
    private Integer type;
    private String uri;
    private Integer enable;
    private Date createTime;
    private String sort;

    @Override
    public String getAuthority() {
        // 这里返回的内容要和Controller里的@PreAuthorize("hasAuthority('wx:product:read')")匹配
        // 详细说明见课程文档的
        return this.value;
    }
}
